package com.ailk.evaluation.common;

import java.util.List;
import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 
 */
public class PageResponse extends OutputResult{
	Log log = LogFactory.getLog(PageResponse.class);	
	private long complete;
	private long pageCount;
	private long current;

	/**
	 * @param result
	 * @param pageNumber
	 * @param complete
	 */
	public PageResponse(List<Map> list, int current, int pageSize, int totalCount) {
		super(list);
		this.complete = totalCount;
		this.current = current;
		this.list = list;
		this.pageCount = totalCount%pageSize == 0 ? totalCount/pageSize : totalCount/pageSize+1;  
	}

	public long getComplete() {
		return complete;
	}


	public List<Map> getList() {
		return list;
	}
	
	public long getCurrent() {
		return current;
	}
	
	public long getPageCount() {
		return this.pageCount;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}
}
